From: Suravee Suthikulpanit Date: Wed, 8 Jun 2016 12:13:59 +0000 (+0200) Subject: x86/hvm: add check when register io handler X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1008 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=aefa50645cad7982f8b2b1ab33995cafe32787b2;p=xen.git x86/hvm: add check when register io handler At the time of registering HVM I/O handler, the HVM domain might not have been initialized, which means the hvm_domain.io_handler would be NULL. In the hvm_next_io_handler(), this should be asserted. Signed-off-by: Suravee Suthikulpanit Reviewed-by: Paul Durrant --- diff --git a/xen/arch/x86/hvm/intercept.c b/xen/arch/x86/hvm/intercept.c index fc757d0af7..bf141c9905 100644 --- a/xen/arch/x86/hvm/intercept.c +++ b/xen/arch/x86/hvm/intercept.c @@ -258,6 +258,8 @@ struct hvm_io_handler *hvm_next_io_handler(struct domain *d) { unsigned int i = d->arch.hvm_domain.io_handler_count++; + ASSERT(d->arch.hvm_domain.io_handler); + if ( i == NR_IO_HANDLERS ) { domain_crash(d);